//
//  RootViewController.m
//  嘀嘀拍
//
//  Created by wangjia_01 on 16/2/25.
//  Copyright © 2016年 wangjia_01. All rights reserved.
//

#import "RootViewController.h"
#import "PersonViewController.h"
#import "ControlViewController.h"
#import "VideoCameraViewController.h"
#import "DidiPaiViewController.h"
@interface RootViewController ()

@end

@implementation RootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self AddViewController];

   // self.view.backgroundColor =[UIColor whiteColor];
    // Do any additional setup after loading the view.
}

-(void)viewWillDisappear:(BOOL)animated
{
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


-(void)AddViewController
{
    DidiPaiViewController * didipai =[[DidiPaiViewController alloc]init];
    VideoCameraViewController * video = [[VideoCameraViewController alloc]init];
    ControlViewController * controller =[[ControlViewController alloc]init];
    PersonViewController * person =[[PersonViewController alloc]init];
    
    UINavigationController * didipaiNavi = [[UINavigationController alloc]initWithRootViewController:didipai];
    UINavigationController * videoNavi = [[UINavigationController alloc]initWithRootViewController:video];
    UINavigationController * controllerNavi = [[UINavigationController alloc]initWithRootViewController:controller];
    UINavigationController * personNavi = [[UINavigationController alloc]initWithRootViewController:person];
    
    //添加对应子视图
    [self addChildViewController:didipaiNavi];
    [self addChildViewController:videoNavi];
    [self addChildViewController:controllerNavi];
    [self addChildViewController:personNavi];
    //设置子视图的响应属性、;
    //定制UITabBarItem的属性
    UITabBarItem * didipaiItem = [[UITabBarItem alloc]initWithTitle:@"工作" image:[UIImage imageNamed:@"camera"] selectedImage:[UIImage imageNamed:@"camera"]];
    didipai.tabBarItem = didipaiItem;
    
    UITabBarItem * videoItem = [[UITabBarItem alloc]initWithTitle:@"摄像机" image:[UIImage imageNamed:@"video"] selectedImage:[UIImage imageNamed:@"video"]];
    
    video.tabBarItem = videoItem;
    UITabBarItem * controllerItem =[[ UITabBarItem alloc]initWithTitle:@"设备控制" image:[UIImage imageNamed:@"controll"] selectedImage:[UIImage imageNamed:@"controll"]];
    controller.tabBarItem = controllerItem;
    UITabBarItem * personItem = [[UITabBarItem alloc]initWithTitle:@"我的" image:[UIImage imageNamed:@"person"] selectedImage:[UIImage imageNamed:@"person"]];
    person.tabBarItem = personItem;
    
    
}



@end
